/*
 * @Description: 
 * @Author: 胡涛
 * @Date: 2023-09-11 09:46:47
 * @LastEditors: 胡涛
 * @LastEditTime: 2023-09-11 21:56:46
 */
import * as uuid from "uuid";

export const EmptyGuid = "00000000-0000-0000-0000-000000000000";

/**
 * 创建随机生成的GUID
 * @returns
 */
export const createNewGuid = () => {
  return uuid.v4();
};

/**
 * 创建带时间戳信息的GUID
 * @returns
 */
export const createNewUuid = () => {
  return uuid.v1();
};

/**
 *  判断是否为GUID
 * @param guid
 * @returns
 */
export const isGuid = (guid: string): boolean => {
  return uuid.uuidValidate(guid);
};
